{extend name="public/header" /}
{block name="body"}
<body>
{include file="public/common" /}
<!--头部搜索开始-->
<div class="layui-collapse" lay-accordion="">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">搜索</h2>
        <div class="layui-colla-content layui-show">
            <form class="layui-form" action="{:url('userlog/index')}">
                <div class="layui-form">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input class="layui-input" name="username" value="{$pageMaps.username|default=''}" placeholder="账号">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <select name="type">
                            <option value="">分类</option>
                            <option value="1" {if condition="$pageMaps.type eq 1" } selected {/if} >注册</option>
                            <option value="2" {if condition="$pageMaps.type eq 2" } selected {/if} >登录</option>
                            <option value="3" {if condition="$pageMaps.type eq 3" } selected {/if} >编辑</option>
                        </select>
                    </div>

                    <div class="layui-inline">
                        <button lay-submit class="layui-btn" lay-filter="search"><i class="layui-icon">&#xe615;</i>查找</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!--头部搜索结束-->
<div class="layui-form">
    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th width="80">ID</th>
            <th>账号</th>
            <th>分类</th>
            <th>内容</th>
            <th>IP</th>
            <th>时间</th>
            <th width="120">操作</th>
        </tr>
        </thead>
        <tbody>
        {if(count($list)<1)}
        <tr>
            <td colspan="7" align="center">暂无相关数据</td>
        </tr>
        {else /}
        {volist name='list' id='vo' key='k'}
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.username}</td>
            <td>
                {if $vo.type==1}注册{/if}
                {if $vo.type==2}登录{/if}
                {if $vo.type==3}编辑{/if}
            </td>
            <td>{$vo.note}</td>
            <td>{$vo.ip}</td>
            <td>{:rttime($vo['addtime'])}</td>
            <td>
                <a class="layui-btn layui-btn-xs layui-btn-danger ajax-del" data-url='{:url("userlog/del")}' data-field='id' data-value='{$vo.id}'>
                    <i class="layui-icon">&#xe640;</i>删除
                </a>
            </td>
        </tr>
        {/volist}
        {/if}
        </tbody>
    </table>
</div>
<div class="text-right">
    <div class="layui-box layui-laypage layui-laypage-molv" id="layui-laypage">
        {$_page|raw}
    </div>
</div>
</body>
{/block}
{block name="script"}
<script>
    layui.use(['jquery', 'laydate', 'form', 'layajax', 'layer'], function () {
        var $ = layui.jquery
            , form = layui.form
            , laydate = layui.laydate
            , layer = layui.layer
            , layajax = layui.layajax;

        form.render();
    });
</script>
{/block}